package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.SafetyMapper;
import com.youlai.boot.system.mapper.SoilMapper;
import com.youlai.boot.system.model.QB.Soil;
import com.youlai.boot.system.service.SoilService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class SoilServiceImpl extends ServiceImpl<SoilMapper, Soil> implements SoilService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private SoilMapper soilMapper;
    @Override
    public boolean saveSoil(Soil soil) {

        soil.setAddtime(LocalDateTime.now());
        return save(soil);
    }

    @Override
    public List<Soil> getAllSoil() {
        return soilMapper.selectList(null);
    }

    @Override
    public boolean deleteSoilById(Integer id) {
        return baseMapper.deleteById(id) >0;
    }
}
